import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Bullet')
export class Bullet extends Component {
    @property
    speed: number = 500;
    start() {

    }

    update(deltaTime: number) {
        this.node.setPosition(this.node.getPosition().add3f(0, this.speed * deltaTime, 0));
        if(this.node.getPosition().y > 440){
            this.node.destroy();
        }
    }
}


